#!/bin/bash

set -e

VERSION=$(cat Dockerfile | grep '^ENV VERSION' | cut -d" " -f3)
TAGS=($VERSION 7)

for TAG in "${TAGS[@]}"; do
  echo "===> Tagging $IMAGE_NAME as $DOCKER_REPO:$CACHE_TAG-$TAG"
  docker tag $IMAGE_NAME $DOCKER_REPO:$CACHE_TAG-$TAG
  echo "===> Pushing $DOCKER_REPO:$CACHE_TAG-$TAG"
  docker push $DOCKER_REPO:$CACHE_TAG-$TAG
done
